﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using JumbotCms.API;
namespace JumbotCms.Modules.Version.Plus
{
    public partial class _sourcedown : JumbotCms.API.FrontHtml
    {
        protected void Page_Unload(object sender, EventArgs e)
        {
            SavePageLog(1);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Server.ScriptTimeout = 8;//脚本过期时间
            string id = Str2Str(q("id"));
            if (id == "0")
            {
                FinalMessage("请不要修改地址栏参数!", site.Dir, 0, 8);
                Response.End();
            }
            doh.Reset();
            doh.ConditionExpress = "id=" + id + " and State<3";
            string downUrl = doh.GetValue("jcms_module_version_source", "DownUrl2").ToString();
            //如果地址不为空
            if (downUrl != "")
                DownloadFile(downUrl);
            else
                FinalMessage("参数有错误!", site.Dir, 0, 8);
        }
    }
}
